package com.symria.server.po;

import java.util.ArrayList;
import java.util.Date;
import java.util.List;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import static javax.persistence.GenerationType.IDENTITY;
import javax.persistence.Id;
import javax.persistence.Table;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;
import javax.persistence.Transient;

import org.hibernate.annotations.Formula;

/**
 * PackInfo entity. @author MyEclipse Persistence Tools
 */
@Entity
@Table(name = "PACK_INFO")
public class PackInfo implements java.io.Serializable {

	// Fields

	private Integer id;
	private String packName;
	private Integer customId;
	private String packOwner;
	private Double packPrice;
	private Date beginDate;
	private Integer channelId;
	private String channelName;
	private Double payPrice;
	private String state;
	private String checkUrl;
	private String pushDesc;
	private String apkName;
	private String mobile;
	private String packDesc;
	private List<Object[]> list= new ArrayList<Object[]>();
	private Integer sumActionCount;
	private Integer sumFactCount;
	private Double payMoney;
	private Double getMoney;
    private Double profit;
    private String packUrl;
	// Constructors

	/** default constructor */
	public PackInfo() {
	}

	/** full constructor */
	public PackInfo(String packName, String packOwner, Double packPrice,
			Date beginDate, Integer channelId, Double payPrice, String state,
			String checkUrl, String pushDesc, String apkName, String mobile,
			String packDesc) {
		this.packName = packName;
		this.packOwner = packOwner;
		this.packPrice = packPrice;
		this.beginDate = beginDate;
		this.channelId = channelId;
		this.payPrice = payPrice;
		this.state = state;
		this.checkUrl = checkUrl;
		this.pushDesc = pushDesc;
		this.apkName = apkName;
		this.mobile = mobile;
		this.packDesc = packDesc;
	}

	
	
	@Formula("(select u.REAL_NAME from USER_INFO u where u.USER_ID=CHANNEL_ID)")
	public String getChannelName() {
		return channelName;
	}

	public void setChannelName(String channelName) {
		this.channelName = channelName;
	}

	// Property accessors
	@Id
	@GeneratedValue(strategy = IDENTITY)
	@Column(name = "ID", unique = true, nullable = false)
	public Integer getId() {
		return this.id;
	}

	public void setId(Integer id) {
		this.id = id;
	}
	@Column(name = "PACK_URl", length = 256)
	public String getPackUrl() {
		return packUrl;
	}

	public void setPackUrl(String packUrl) {
		this.packUrl = packUrl;
	}

	@Column(name = "PACK_NAME", length = 32)
	public String getPackName() {
		return this.packName;
	}

	public void setPackName(String packName) {
		this.packName = packName;
	}

	//@Column(name = "PACK_OWNER", length = 32)
	@Formula("(select c.COM_NAME from CUSTOM_INFO c where c.ID=CUSTOM_ID)")
	public String getPackOwner() {
		return this.packOwner;
	}

	public void setPackOwner(String packOwner) {
		this.packOwner = packOwner;
	}

	@Column(name = "PACK_PRICE", precision = 10)
	public Double getPackPrice() {
		return this.packPrice;
	}

	public void setPackPrice(Double packPrice) {
		this.packPrice = packPrice;
	}

	@Temporal(TemporalType.DATE)
	@Column(name = "BEGIN_DATE", length = 0)
	public Date getBeginDate() {
		return this.beginDate;
	}

	public void setBeginDate(Date beginDate) {
		this.beginDate = beginDate;
	}

	@Column(name = "CHANNEL_ID")
	public Integer getChannelId() {
		return this.channelId;
	}

	public void setChannelId(Integer channelId) {
		this.channelId = channelId;
	}

	@Column(name = "PAY_PRICE", precision = 10)
	public Double getPayPrice() {
		return this.payPrice;
	}

	public void setPayPrice(Double payPrice) {
		this.payPrice = payPrice;
	}

	@Column(name = "STATE", length = 1)
	public String getState() {
		return this.state;
	}

	public void setState(String state) {
		this.state = state;
	}

	@Column(name = "CHECK_URL", length = 256)
	public String getCheckUrl() {
		return this.checkUrl;
	}

	public void setCheckUrl(String checkUrl) {
		this.checkUrl = checkUrl;
	}

	@Column(name = "PUSH_DESC", length = 32)
	public String getPushDesc() {
		return this.pushDesc;
	}

	public void setPushDesc(String pushDesc) {
		this.pushDesc = pushDesc;
	}

	@Column(name = "APK_NAME", length = 128)
	public String getApkName() {
		return this.apkName;
	}

	public void setApkName(String apkName) {
		this.apkName = apkName;
	}

	@Column(name = "MOBILE", length = 256)
	public String getMobile() {
		return this.mobile;
	}

	public void setMobile(String mobile) {
		this.mobile = mobile;
	}

	@Column(name = "PACK_DESC", length = 256)
	public String getPackDesc() {
		return this.packDesc;
	}

	public void setPackDesc(String packDesc) {
		this.packDesc = packDesc;
	}
	
    @Transient
	public List<Object[]> getList() {
		return list;
	}
	public void setList(List<Object[]> list) {
		this.list = list;
	}
	@Transient
	public Integer getSumActionCount() {
		return sumActionCount;
	}

	public void setSumActionCount(Integer sumActionCount) {
		this.sumActionCount = sumActionCount;
	}
	@Transient
	public Integer getSumFactCount() {
		return sumFactCount;
	}

	public void setSumFactCount(Integer sumFactCount) {
		this.sumFactCount = sumFactCount;
	}
	@Transient
	public Double getPayMoney() {
		return payMoney;
	}

	public void setPayMoney(Double payMoney) {
		this.payMoney = payMoney;
	}
	@Transient
	public Double getGetMoney() {
		return getMoney;
	}

	public void setGetMoney(Double getMoney) {
		this.getMoney = getMoney;
	}
	@Transient
	public Double getProfit() {
		return profit;
	}

	public void setProfit(Double profit) {
		this.profit = profit;
	}
	@Column(name = "CUSTOM_ID")
	public Integer getCustomId() {
		return customId;
	}

	public void setCustomId(Integer customId) {
		this.customId = customId;
	}
	
	
	
	
}